﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TestForm
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            FERROU8API.JsonModel.Component c=new FERROU8API.JsonModel.Component();
            c.baseuseqty = 1;
            c.issueqty = 2;
            c.material = "001";
            c.mono = "a1";
            FERROU8API.JsonModel.OperateData<FERROU8API.JsonModel.Component> d = new FERROU8API.JsonModel.OperateData<FERROU8API.JsonModel.Component>(c);
            d.code = "100";
            d.message = "出错";
            d.restful = 0;
            d.data = "";// c.ToJson();
            String s = d.ToJson();
            String s1 = s;
            FERROU8API.JsonModel.OperateData<FERROU8API.JsonModel.Component> d1 = FERROU8API.JsonModel.OperateData<FERROU8API.JsonModel.Component>.FromJson(s1);
            String s2 = "";
            s2 += "1";
        }

        private void button2_Click(object sender, EventArgs e)
        {
            FERROU8API.JsonModel.Component c = new FERROU8API.JsonModel.Component();
            c.baseuseqty = 1;
            c.baseqty = 2;
            c.issueqty = 2;
            c.mobody = "1000000116";
            c.material = "01019002081";
            c.operation = 0;
            FERROU8API.JsonModel.Component c1 = new FERROU8API.JsonModel.Component();
            c1.baseuseqty = 3;
            c1.baseqty =4;
            c1.issueqty = 3;
            c1.mobody = "1000000116";
            c1.material = "01019002082";
            c1.operation = 0;
            List<FERROU8API.JsonModel.Component> cs = new List<FERROU8API.JsonModel.Component>();
            cs.Add(c);
            cs.Add(c1);
            String ssx = FERROU8API.JsonModel.JsonHelper.ToJson(cs);
            FERROU8API.JsonModel.OperateData<FERROU8API.JsonModel.Component> d = new FERROU8API.JsonModel.OperateData<FERROU8API.JsonModel.Component>(c);
            d.code = "100";
            d.message = "出错";
            d.restful = 0;
            
            d.data = cs;// c.ToJson();
            String s = d.ToJson();
            String s1 = s;
            FERROU8API.JsonModel.OperateData<FERROU8API.JsonModel.Component> d1 = FERROU8API.JsonModel.OperateData<FERROU8API.JsonModel.Component>.FromJson(s1);
            String s2 = "";
            s2 += "1";
        }

        private void button3_Click(object sender, EventArgs e)
        {
            MaterialOutHelper MaterialOutSV = new MaterialOutHelper();
            MaterialOutSV.Create();
        }
    }
}
